package com.peakmain.homemodule.adapter.decoration;

import android.content.Context;

import com.peakmain.baselibrary.recyclerview.itemdecoration.BaseItemDecoration;
import com.peakmain.homemodule.bean.SearchCityBean;

import java.util.List;

/**
 * author ：Peakmain
 * createTime：2020/2/29
 * mail:2726449200@qq.com
 * describe：城市悬浮列表
 */
public class SectionItemDecoration extends BaseItemDecoration<SearchCityBean> {


    public SectionItemDecoration(Builder builder) {
        super(builder);
    }

    @Override
    public String getTopText(List<SearchCityBean> data, int position) {
        return data.get(position).getSection();
    }
    public static class Builder extends BaseItemDecoration.Builder<SectionItemDecoration.Builder,SearchCityBean>{

        public Builder(Context context, List<SearchCityBean> data) {
            super(context, data);
        }
        @Override
        public SectionItemDecoration create() {
            return new SectionItemDecoration(this);
        }
    }
}
